<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    //  栈    堆  []  []  []

    /**
     *
     * 拓展运算符：...
     * 1. react-:数组拷贝 [...data]
     * 2. reducer  {...state}
     * 3. vuex 辅助函数 ...mapState(['']) ...mapAction([''])
     *
     *
     *   [...['devin', '01', '02']]
     *
     * 函数参数的 ...rest （聚合参数功能）必须放在函数的最后一个参数
     *
     */

    function getList(...opt) {
      console.log(opt[0])
    }

    getList(['1801A', '班长', '学委', '组长'])

    // getList({
    //   page: 1,
    //   size: 10,
    //   total: 50,
    //   value: false
    // })


    let data = [{ name: 1, age: 23 }, '1801A', '50', '80'];
    let data1 = ['k', '1802A', '30']
    let copy1 = [...data];
    data[0].age = 25
    // console.log(copy1, data)

    // let result = [...data, ...data1]
    // console.log(result, 'result')


  </script>
</body>

</html>
